package com.lzx.article.controller.web;

import com.lzx.article.entity.CommentsGiveALike;
import com.lzx.article.service.CommentsGiveALikeService;
import com.lzx.common.utils.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 程序员星星
 * @date 2023/2/1
 * @Description
 */
@RestController
@RequestMapping("/article/commentsGiveALike/web")
public class WebCommentsGiveALikeController {
    @Resource
    private CommentsGiveALikeService commentsGiveALikeService;

    //根据文章id和用户id查询用户点赞信息
    @GetMapping("/selectCommentsGiveALive/{articleId}/{userId}")
    public R selectCommentsGiveALive(@PathVariable Long articleId, @PathVariable Long userId) {
        return commentsGiveALikeService.selectCommentsGiveALive(articleId, userId);
    }

    //评论点赞
    @PostMapping("/giveALikeToComments")
    public R giveALikeToComments(@RequestBody CommentsGiveALike commentsGiveALike) {
        return commentsGiveALikeService.giveALikeToComments(commentsGiveALike);
    }
}
